# stage1: build sort.c

clang -O3 -Wl,--emit-relocs sort.c


# stage2: intrument

llvm-bolt a.out -instrument -o a.out.instrumented

# stage3: run app

./a.out.instrumented

# stage4: copy .fdata

cp /tmp/prof.fdata perf.fdata

# stage5: bolt app

llvm-bolt a.out -o a.out.bolt.instrument -data=perf.fdata -reorder-blocks=ext-tsp -reorder-functions=hfsort -split-functions -split-all-cold -split-eh -dyno-stats


# stage6: test

./a.out

./a.out.bolt.instrument
